package aws;

/**
 *  计算a+b
 */
public class Add {

    private int add(int a, int b) {
        do {
            int add = a ^ b;
            int carry = (a & b) << 1;
            a = add;
            b = carry;
        } while (b != 0);
        return a;
    }

    public static void main(String[] args) {
        System.out.println(new Add().add(5,7));
    }

}
